Api.Connect 方法
連接到 Runtime 電腦。第一個呼叫的 API。
命名空間:IntervalZero.KINGSTAR.OpcUa.Api
組合: IntervalZero.KINGSTAR.OpcUa.Api (於 IntervalZero.KINGSTAR.OpcUa.Client.dll) 版本:4.4.0.0
語法
public Task<bool> Connect(
string serverUrl,
UserRole user,
string user_pasword,
int port = 62567
string path = "IntervalZero/KINGSTAR/OpcUa/Server"
)
Public Function Connect Connect( serverUrl As String, User As UserRole, user_pasword As String, Optional port As Integer = 62567 Optional path As String = "IntervalZero/KINGSTAR/OpcUa/Server
As Task(Of Boolean)
)
參數
serverUrl
型別:string
Runtime 電腦的 URL 或 IP。
user
型別:UserRole
欲用來連接的使用者角色。
user_pasword
型別:string
使用者密碼。
port [optional]
型別:int
除非伺服器設置為自訂設定,否則請保留預設值。
path [optional]
型別:string
除非伺服器設置為自訂設定,否則請保留預設值。
備註
在 OPC UA 介面上,此方法永遠都應第一個被呼叫。若在呼叫 Connect 前先呼叫其他方法,則會回傳錯誤代碼。
參見